import Vue from 'vue'
import App from './App.vue'
import router from './router/index'
import './plugins/element.js'
import axios from 'axios'

import './assets/css/global.css'

import api from './api.js'
//命名并设置全局变量

Vue.config.productionTip = false

// 带上token
axios.interceptors.request.use(config=>{
  config.headers.token = window.sessionStorage.getItem('token');
  return config;
})
Vue.prototype.$ajax = axios
Vue.prototype.$API = api;

new Vue({
  router,
  render: h => h(App),

}).$mount('#app')

